﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AnimListPanel : MonoBehaviour
{
    public AnimItem animItem;
    public GameObject root,cacheRoot;

    private string[] animList;
    private UIObjCacheProcess<AnimItem> itemPool;
    public void OpenAnimList(string[] animList)
    {
        if (itemPool == null)
        {
            itemPool = new UIObjCacheProcess<AnimItem>(cacheRoot.transform,root.transform, animItem);
        }
        this.animList = animList;
        foreach (var item in animList)
        {
            var obj = itemPool.Spawn();
            obj.SetData(item);
        }
    }
}
